﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Text;

namespace ACFaceAPI.yufan.Model
{
    public class YuFanConfig
    {
        /// <summary>
        /// 
        /// </summary>
        public string applicationName { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public string comModContent { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int comModType { get; set; } = -1;
        /// <summary>
        /// 人脸识别
        /// </summary>
        public string companyName { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int delayTimeForCloseDoor { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int delayTimeForCloseLed { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string displayModContent { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public string displayModStrangerContent { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int displayModStrangerType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int displayModType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int identifyDistance { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int identifyScores { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int isOpenRelay { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int multiplayerDetection { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recCardFaceValue { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recDoubleValue { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recFaceCardValue { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string recFailWiegandContent { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int recFailWiegandType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeCardEnable { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeCardFaceEnable { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeCardFaceHardware { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeCardFaceIntf { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeCardHardware { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeCardIntf { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeCardPhoto { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeDOBEnable { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeFaceEnable { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeIdcardFaceEnable { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeIdcardFaceHardware { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recModeIdcardFaceIntf { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string recNoPerComModeContent { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int recNoPerComModeType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string recNoPerDisplayText1Content { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int recNoPerDisplayText1Type { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string recNoPerDisplayText2Content { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int recNoPerDisplayText2Type { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recNoPerRelayType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string recNoPerTtsModeContent { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int recNoPerTtsModeType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string recNoPerWiegandContent { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int recNoPerWiegandType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recRank { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recStrangerTimesThreshold { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recStrangerType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string recSucDisplayText2Content { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int recSucDisplayText2Type { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string recSucWiegandContent { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int recSucWiegandType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int recType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int regInterval { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int relaySwitch { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int repeatRegEnable { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int saveIdentifyTime { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string scrDisplayText1Content { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int scrDisplayText1Type { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string scrDisplayText2Content { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int scrDisplayText2Type { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string serialOutContent { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int serialOutMode { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int showDeviceKey { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int showIp { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int showPeopleNum { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string ttsModContent { get; set; } = "-1";
        /// <summary>
        /// 注意陌生人
        /// </summary>
        public string ttsModStrangerContent { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int ttsModStrangerType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int ttsModType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public string wg { get; set; } = "-1";
        /// <summary>
        /// 
        /// </summary>
        public int wgInputContentType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int wgInputType { get; set; } = -1;
        /// <summary>
        /// 
        /// </summary>
        public int whitelist { get; set; } = -1;

        public JObject ToJObject()
        {
            JObject jo = new JObject();
            foreach (var item in typeof(YuFanConfig).GetProperties())
            {
                
                if (item.PropertyType==typeof(int) && (int)item.GetValue(this) == -1)
                {
                    continue;
                }
                if (item.PropertyType == typeof(string) && (string)item.GetValue(this) == "-1")
                {
                    continue;
                }
                if (item.GetValue(this) == null)
                {
                    continue;
                }
                jo.Add(item.Name,item.GetValue(this).ToString());
            }
            return jo;
        }
    }
}
